<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'questionario-form',
	'enableAjaxValidation'=>true,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
	
	<div class="row">
		<?php echo $form->labelEx($model,'id_usuario'); ?>
		<?php echo $form->textField($model,'id_usuario'); ?>
		<?php echo $form->error($model,'id_usuario'); ?>
	</div>
	
	<?php $model->preLoad(); ?>
	
	<?php foreach ($model->respostas as $resp):?>
		<div class="row">
			<?php echo $form->labelEx($model, $resp->pergunta->pergunta); ?>
			<?php echo $form->textArea($resp,'resposta['.$resp->pergunta->id_pergunta.']',array('rows'=>6, 'cols'=>50)); ?>
		</div>
	<?php endforeach;?>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->